package cn.jiaochengziyuan;

import redis.clients.jedis.Jedis;

import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * redis 事务锁，
 */
public class Application {
    public static ThreadPoolExecutor pool=new ThreadPoolExecutor(
      10,100,10, TimeUnit.SECONDS,
      new LinkedBlockingDeque<Runnable>()
    );
    public static void main(String[] args) {
        Jedis jedis=new Jedis("localhost",6379);
        jedis.auth("abc123456");
        jedis.select(1);
        jedis.set("kill_num","50");
        jedis.del("kill_list");
        jedis.close();
        for (int i=0;i<1000;i++){
            pool.execute(new KillTask());
        }
    }
}
